// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   UnitInfo.java

package include.nseer_cookie;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class UnitInfo
{

	private String unit_db_name;
	private String unit_name;
	private nseer_db db;

	public UnitInfo()
	{
		unit_db_name = "";
		unit_name = "";
	}

	public String getDbName(String unit_id)
	{
		try
		{
			db = new nseer_db("mysql");
			String sql = (new StringBuilder("select * from unit_info where unit_id='")).append(unit_id).append("'").toString();
			ResultSet rs = db.executeQuery(sql);
			if (rs.next())
				unit_db_name = rs.getString("unit_db_name");
			db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return unit_db_name;
	}

	public String getUnitName(String unit_id)
	{
		try
		{
			db = new nseer_db("mysql");
			String sql = (new StringBuilder("select * from unit_info where unit_id='")).append(unit_id).append("'").toString();
			ResultSet rs = db.executeQuery(sql);
			if (rs.next())
				unit_name = rs.getString("unit_name");
			db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return unit_name;
	}
}
